<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>Paho C++: src/mqtt/async_client.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="pahologo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Paho C++
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">The Paho MQTT C++ Client Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('async__client_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">async_client.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="async__client_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment">/*******************************************************************************</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Copyright (c) 2013-2017 Frank Pagliughi &lt;fpagliughi@mindspring.com&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * All rights reserved. This program and the accompanying materials</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * are made available under the terms of the Eclipse Public License v1.0</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * and Eclipse Distribution License v1.0 which accompany this distribution.</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * The Eclipse Public License is available at</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> *    http://www.eclipse.org/legal/epl-v10.html</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * and the Eclipse Distribution License is available at</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> *   http://www.eclipse.org/org/documents/edl-v10.php.</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * Contributors:</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> *    Frank Pagliughi - initial implementation and documentation</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment"> *******************************************************************************/</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef __mqtt_async_client_h</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __mqtt_async_client_h</span></div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;MQTTAsync.h&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="types_8h.html">mqtt/types.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="token_8h.html">mqtt/token.h</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="string__collection_8h.html">mqtt/string_collection.h</a>&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="delivery__token_8h.html">mqtt/delivery_token.h</a>&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="iclient__persistence_8h.html">mqtt/iclient_persistence.h</a>&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="iaction__listener_8h.html">mqtt/iaction_listener.h</a>&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="exception_8h.html">mqtt/exception.h</a>&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="message_8h.html">mqtt/message.h</a>&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="callback_8h.html">mqtt/callback.h</a>&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="thread__queue_8h.html">mqtt/thread_queue.h</a>&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="iasync__client_8h.html">mqtt/iasync_client.h</a>&quot;</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;list&gt;</span></div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#include &lt;tuple&gt;</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#include &lt;stdexcept&gt;</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keyword">namespace </span>mqtt {</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;<span class="keyword">const</span> uint32_t VERSION = 0x00090000;</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="keyword">const</span> <span class="keywordtype">string</span> VERSION_STR(<span class="stringliteral">&quot;Paho MQTT C++ (mqttpp) v. 0.9&quot;</span>);</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="keyword">const</span> <span class="keywordtype">string</span> COPYRIGHT(<span class="stringliteral">&quot;Copyright (c) 2013-2017 Frank Pagliughi&quot;</span>);</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html">   60</a></span>&#160;<span class="keyword">class </span><a class="code" href="classmqtt_1_1async__client.html">async_client</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="classmqtt_1_1iasync__client.html">iasync_client</a></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;{</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a47a444965a20ce8d44d5d10132b8e087">   64</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="classmqtt_1_1async__client.html#a47a444965a20ce8d44d5d10132b8e087">ptr_t</a> = std::shared_ptr&lt;async_client&gt;;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a45fb67d0f3d678c1d964ec057bf1a473">   66</a></span>&#160;    <span class="keyword">using</span> <a class="code" href="classmqtt_1_1async__client.html#a45fb67d0f3d678c1d964ec057bf1a473">consumer_queue_type</a> = std::unique_ptr&lt;thread_queue&lt;const_message_ptr&gt;&gt;;</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <span class="keyword">using</span> guard = std::unique_lock&lt;std::mutex&gt;;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keyword">using</span> unique_lock = std::unique_lock&lt;std::mutex&gt;;</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="keyword">mutable</span> std::mutex lock_;</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    MQTTAsync cli_;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordtype">string</span> serverURI_;</div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <span class="keywordtype">string</span> clientId_;</div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    std::unique_ptr&lt;MQTTClient_persistence&gt; persist_;</div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <a class="code" href="classmqtt_1_1callback.html">callback</a>* userCallback_;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    token_ptr connTok_;</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    std::list&lt;token_ptr&gt; pendingTokens_;</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    std::list&lt;delivery_token_ptr&gt; pendingDeliveryTokens_;</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <a class="code" href="classmqtt_1_1async__client.html#a45fb67d0f3d678c1d964ec057bf1a473">consumer_queue_type</a> que_;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> on_connected(<span class="keywordtype">void</span>* context, <span class="keywordtype">char</span>* cause);</div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> on_connection_lost(<span class="keywordtype">void</span> *context, <span class="keywordtype">char</span> *cause);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span>  on_message_arrived(<span class="keywordtype">void</span>* context, <span class="keywordtype">char</span>* topicName, <span class="keywordtype">int</span> topicLen,</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;                                   MQTTAsync_message* msg);</div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> on_delivery_complete(<span class="keywordtype">void</span>* context, MQTTAsync_token tok);</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;</div>
<div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#ad1520136c41afff5cd24bf19d9bf76e5">  103</a></span>&#160;    <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classmqtt_1_1token.html">token</a>;</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> add_token(token_ptr tok);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> add_token(delivery_token_ptr tok);</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> remove_token(<a class="code" href="classmqtt_1_1token.html">token</a>* tok) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> remove_token(token_ptr tok) { remove_token(tok.get()); }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    <span class="keywordtype">void</span> remove_token(delivery_token_ptr tok) { remove_token(tok.get()); }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;</div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    async_client() =<span class="keyword">delete</span>;</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    async_client(<span class="keyword">const</span> async_client&amp;) =<span class="keyword">delete</span>;</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    async_client&amp; operator=(<span class="keyword">const</span> async_client&amp;) =<span class="keyword">delete</span>;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    async_client(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; serverURI, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; clientId,</div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;                 <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; persistDir);</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    async_client(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; serverURI, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; clientId,</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;                 iclient_persistence* persistence=<span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    async_client(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; serverURI, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; clientId,</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;                 <span class="keywordtype">int</span> maxBufferedMessages, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; persistDir);</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    async_client(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; serverURI, <span class="keyword">const</span> <span class="keywordtype">string</span>&amp; clientId,</div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;                 <span class="keywordtype">int</span> maxBufferedMessages, iclient_persistence* persistence=<span class="keyword">nullptr</span>);</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    <a class="code" href="classmqtt_1_1async__client.html#ad42f0639330fffbfe8b9d010be301613">~async_client</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#aee06a4438b2075de021bbf8d5b6b0c33">connect</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#aee06a4438b2075de021bbf8d5b6b0c33">connect</a>(connect_options options) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#aee06a4438b2075de021bbf8d5b6b0c33">connect</a>(connect_options options, <span class="keywordtype">void</span>* userContext,</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;                       iaction_listener&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#ae68c924e65104b40488cba072597baeb">  220</a></span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ae68c924e65104b40488cba072597baeb">connect</a>(<span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb)<span class="keyword"> override </span>{</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#aee06a4438b2075de021bbf8d5b6b0c33">connect</a>(<a class="code" href="classmqtt_1_1connect__options.html">connect_options</a>{}, userContext, cb);</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    }</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a93cad44caab9aa829745477b170eae3d">reconnect</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00235"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">  235</a></span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>()<span class="keyword"> override </span>{ <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>(<a class="code" href="classmqtt_1_1disconnect__options.html">disconnect_options</a>()); }</div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>(<a class="code" href="classmqtt_1_1disconnect__options.html">disconnect_options</a> opts) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>(<span class="keywordtype">int</span> timeout) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> Rep, <span class="keyword">class</span> Period&gt;</div>
<div class="line"><a name="l00266"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#ad56d21f49709f195e1af37becfc4e0ee">  266</a></span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ad56d21f49709f195e1af37becfc4e0ee">disconnect</a>(<span class="keyword">const</span> std::chrono::duration&lt;Rep, Period&gt;&amp; timeout) {</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        <span class="comment">// TODO: check range</span></div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>((<span class="keywordtype">int</span>) to_milliseconds_count(timeout));</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;    }</div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>(<span class="keywordtype">int</span> timeout, <span class="keywordtype">void</span>* userContext,</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;                         <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> Rep, <span class="keyword">class</span> Period&gt;</div>
<div class="line"><a name="l00301"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a5f9175e2992ec07e0d27286f875ba107">  301</a></span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a5f9175e2992ec07e0d27286f875ba107">disconnect</a>(<span class="keyword">const</span> std::chrono::duration&lt;Rep, Period&gt;&amp; timeout,</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;                         <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) {</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;        <span class="comment">// TODO: check range</span></div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>((<span class="keywordtype">int</span>) to_milliseconds_count(timeout), userContext, cb);</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    }</div>
<div class="line"><a name="l00317"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#adf9676f95c8b6c1b4a605d5fd8b8c251">  317</a></span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#adf9676f95c8b6c1b4a605d5fd8b8c251">disconnect</a>(<span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb)<span class="keyword"> override </span>{</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">disconnect</a>(0L, userContext, cb);</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    }</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#adac62c2c80ed3a1c32582b97e6e357ed">get_pending_delivery_token</a>(<span class="keywordtype">int</span> msgID) <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    std::vector&lt;delivery_token_ptr&gt; <a class="code" href="classmqtt_1_1async__client.html#aec00d760cb3a6db6ac633c48365207d5">get_pending_delivery_tokens</a>() <span class="keyword">const override</span>;</div>
<div class="line"><a name="l00334"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a8105627f112a23e5c8067901cf1650a2">  334</a></span>&#160;    <span class="keywordtype">string</span> <a class="code" href="classmqtt_1_1async__client.html#a8105627f112a23e5c8067901cf1650a2">get_client_id</a>()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> clientId_; }</div>
<div class="line"><a name="l00339"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#ad2cc6dc75715f467c8c0556f0f0c6c04">  339</a></span>&#160;    <span class="keywordtype">string</span> <a class="code" href="classmqtt_1_1async__client.html#ad2cc6dc75715f467c8c0556f0f0c6c04">get_server_uri</a>()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> serverURI_; }</div>
<div class="line"><a name="l00344"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#aefe2b8717b52d9b6c92f0ea8d89a3dbe">  344</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1async__client.html#aefe2b8717b52d9b6c92f0ea8d89a3dbe">is_connected</a>()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> to_bool(MQTTAsync_isConnected(cli_)); }</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> n,</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;                               <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a425e5e48369a523378b6c92de7bf4b85">  367</a></span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a425e5e48369a523378b6c92de7bf4b85">publish</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> n)<span class="keyword"> override </span>{</div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(std::move(topic), payload, n,</div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;                       <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a>);</div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    }</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload,</div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;                               <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00391"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a804df67eff69884958d897294194a351">  391</a></span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a804df67eff69884958d897294194a351">publish</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>, <a class="code" href="classmqtt_1_1buffer__ref.html">binary_ref</a> payload)<span class="keyword"> override </span>{</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(std::move(topic), std::move(payload),</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;                       <a class="code" href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">message::DFLT_QOS</a>, <a class="code" href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">message::DFLT_RETAINED</a>);</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    }</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(<a class="code" href="classmqtt_1_1buffer__ref.html">string_ref</a> <a class="code" href="classmqtt_1_1topic.html">topic</a>,</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;                               <span class="keyword">const</span> <span class="keywordtype">void</span>* payload, <span class="keywordtype">size_t</span> n,</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;                               <span class="keywordtype">int</span> qos, <span class="keywordtype">bool</span> retained,</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;                               <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(const_message_ptr msg) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;    delivery_token_ptr <a class="code" href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">publish</a>(const_message_ptr msg,</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;                               <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1async__client.html#a8b09cc4d4788420926725b7df00d3448">set_callback</a>(<a class="code" href="classmqtt_1_1callback.html">callback</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1async__client.html#ae88e293c7e1431ff7a2f74d032b5fd4b">disable_callbacks</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a8b20a22af1069ef41c27566698bd90bd">subscribe</a>(const_string_collection_ptr topicFilters,</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;                         <span class="keyword">const</span> <a class="code" href="classmqtt_1_1iasync__client.html#aee95659bed2446d0409ce33479f9cdad">qos_collection</a>&amp; qos) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a8b20a22af1069ef41c27566698bd90bd">subscribe</a>(const_string_collection_ptr topicFilters,</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;                         <span class="keyword">const</span> <a class="code" href="classmqtt_1_1iasync__client.html#aee95659bed2446d0409ce33479f9cdad">qos_collection</a>&amp; qos,</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;                         <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a8b20a22af1069ef41c27566698bd90bd">subscribe</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; topicFilter, <span class="keywordtype">int</span> qos) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#a8b20a22af1069ef41c27566698bd90bd">subscribe</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; topicFilter, <span class="keywordtype">int</span> qos,</div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;                        <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ae709e53471db54ec614bcc9d8978361e">unsubscribe</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; topicFilter) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00522"></a><span class="lineno">  522</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ae709e53471db54ec614bcc9d8978361e">unsubscribe</a>(const_string_collection_ptr topicFilters) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ae709e53471db54ec614bcc9d8978361e">unsubscribe</a>(const_string_collection_ptr topicFilters,</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;                           <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;    token_ptr <a class="code" href="classmqtt_1_1async__client.html#ae709e53471db54ec614bcc9d8978361e">unsubscribe</a>(<span class="keyword">const</span> <span class="keywordtype">string</span>&amp; topicFilter,</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;                          <span class="keywordtype">void</span>* userContext, <a class="code" href="classmqtt_1_1iaction__listener.html">iaction_listener</a>&amp; cb) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;</div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1async__client.html#abcdbc13e54bb4ba1e52e8e405297d170">start_consuming</a>();</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="classmqtt_1_1async__client.html#ab5aaa839a2832009148202fa5a81c4f2">stop_consuming</a>();</div>
<div class="line"><a name="l00566"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a479e2e058c190b575f75a17cdc08299b">  566</a></span>&#160;    const_message_ptr <a class="code" href="classmqtt_1_1async__client.html#a479e2e058c190b575f75a17cdc08299b">consume_message</a>() { <span class="keywordflow">return</span> que_-&gt;get(); }</div>
<div class="line"><a name="l00573"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a9260ee858860df9d39dd570cc15f56a1">  573</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1async__client.html#a9260ee858860df9d39dd570cc15f56a1">try_consume_message</a>(const_message_ptr* msg) {</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;        <span class="keywordflow">return</span> que_-&gt;try_get(msg);</div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;    }</div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Rep, <span class="keyword">class</span> Period&gt;</div>
<div class="line"><a name="l00584"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a5613bf9226d6ad9b8dcf15a238c18c23">  584</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1async__client.html#a5613bf9226d6ad9b8dcf15a238c18c23">try_consume_message_for</a>(const_message_ptr* msg,</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;                                 <span class="keyword">const</span> std::chrono::duration&lt;Rep, Period&gt;&amp; relTime) {</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        <span class="keywordflow">return</span> que_-&gt;try_get_for(msg, relTime);</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;    }</div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    <span class="keyword">template</span> &lt;<span class="keyword">class</span> Clock, <span class="keyword">class</span> Duration&gt;</div>
<div class="line"><a name="l00596"></a><span class="lineno"><a class="line" href="classmqtt_1_1async__client.html#a8bc99d5afd5d35aeb0888ff6c08b9ed0">  596</a></span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="classmqtt_1_1async__client.html#a8bc99d5afd5d35aeb0888ff6c08b9ed0">try_consume_message_until</a>(const_message_ptr* msg,</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;                                   <span class="keyword">const</span> std::chrono::time_point&lt;Clock,Duration&gt;&amp; absTime) {</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;        <span class="keywordflow">return</span> que_-&gt;try_get_until(msg, absTime);</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    }</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;};</div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;</div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;<span class="keyword">using</span> async_client_ptr = <a class="code" href="classmqtt_1_1async__client.html#a47a444965a20ce8d44d5d10132b8e087">async_client::ptr_t</a>;</div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;<span class="comment">// end namespace mqtt</span></div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;}</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;</div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;<span class="preprocessor">#endif      // __mqtt_async_client_h</span></div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;<span class="preprocessor"></span></div>
<div class="ttc" id="classmqtt_1_1async__client_html_adf9676f95c8b6c1b4a605d5fd8b8c251"><div class="ttname"><a href="classmqtt_1_1async__client.html#adf9676f95c8b6c1b4a605d5fd8b8c251">mqtt::async_client::disconnect</a></div><div class="ttdeci">token_ptr disconnect(void *userContext, iaction_listener &amp;cb) override</div><div class="ttdoc">Disconnects from the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:317</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_aec00d760cb3a6db6ac633c48365207d5"><div class="ttname"><a href="classmqtt_1_1async__client.html#aec00d760cb3a6db6ac633c48365207d5">mqtt::async_client::get_pending_delivery_tokens</a></div><div class="ttdeci">std::vector&lt; delivery_token_ptr &gt; get_pending_delivery_tokens() const override</div><div class="ttdoc">Returns the delivery tokens for any outstanding publish operations. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html"><div class="ttname"><a href="classmqtt_1_1async__client.html">mqtt::async_client</a></div><div class="ttdoc">Lightweight client for talking to an MQTT server using non-blocking methods that allow an operation t...</div><div class="ttdef"><b>Definition:</b> async_client.h:60</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ad2cc6dc75715f467c8c0556f0f0c6c04"><div class="ttname"><a href="classmqtt_1_1async__client.html#ad2cc6dc75715f467c8c0556f0f0c6c04">mqtt::async_client::get_server_uri</a></div><div class="ttdeci">string get_server_uri() const override</div><div class="ttdoc">Returns the address of the server used by this client. </div><div class="ttdef"><b>Definition:</b> async_client.h:339</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a47a444965a20ce8d44d5d10132b8e087"><div class="ttname"><a href="classmqtt_1_1async__client.html#a47a444965a20ce8d44d5d10132b8e087">mqtt::async_client::ptr_t</a></div><div class="ttdeci">std::shared_ptr&lt; async_client &gt; ptr_t</div><div class="ttdoc">Smart/shared pointer for an object of this class. </div><div class="ttdef"><b>Definition:</b> async_client.h:64</div></div>
<div class="ttc" id="types_8h_html"><div class="ttname"><a href="types_8h.html">types.h</a></div><div class="ttdoc">Basic types and type conversions for the Paho MQTT C++ library. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a93cad44caab9aa829745477b170eae3d"><div class="ttname"><a href="classmqtt_1_1async__client.html#a93cad44caab9aa829745477b170eae3d">mqtt::async_client::reconnect</a></div><div class="ttdeci">token_ptr reconnect() override</div><div class="ttdoc">Reconnects the client using options from the previous connect. </div></div>
<div class="ttc" id="classmqtt_1_1iaction__listener_html"><div class="ttname"><a href="classmqtt_1_1iaction__listener.html">mqtt::iaction_listener</a></div><div class="ttdoc">Provides a mechanism for tracking the completion of an asynchronous action. </div><div class="ttdef"><b>Definition:</b> iaction_listener.h:48</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ae68c924e65104b40488cba072597baeb"><div class="ttname"><a href="classmqtt_1_1async__client.html#ae68c924e65104b40488cba072597baeb">mqtt::async_client::connect</a></div><div class="ttdeci">token_ptr connect(void *userContext, iaction_listener &amp;cb) override</div><div class="ttdef"><b>Definition:</b> async_client.h:220</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a479e2e058c190b575f75a17cdc08299b"><div class="ttname"><a href="classmqtt_1_1async__client.html#a479e2e058c190b575f75a17cdc08299b">mqtt::async_client::consume_message</a></div><div class="ttdeci">const_message_ptr consume_message()</div><div class="ttdoc">Read the next message from the queue. </div><div class="ttdef"><b>Definition:</b> async_client.h:566</div></div>
<div class="ttc" id="thread__queue_8h_html"><div class="ttname"><a href="thread__queue_8h.html">thread_queue.h</a></div><div class="ttdoc">Implementation of the template class &#39;thread_queue&#39;, a thread-safe, blocking queue for passing data b...</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_adac62c2c80ed3a1c32582b97e6e357ed"><div class="ttname"><a href="classmqtt_1_1async__client.html#adac62c2c80ed3a1c32582b97e6e357ed">mqtt::async_client::get_pending_delivery_token</a></div><div class="ttdeci">delivery_token_ptr get_pending_delivery_token(int msgID) const override</div><div class="ttdoc">Returns the delivery token for the specified message ID. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_aefe2b8717b52d9b6c92f0ea8d89a3dbe"><div class="ttname"><a href="classmqtt_1_1async__client.html#aefe2b8717b52d9b6c92f0ea8d89a3dbe">mqtt::async_client::is_connected</a></div><div class="ttdeci">bool is_connected() const override</div><div class="ttdoc">Determines if this client is currently connected to the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:344</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_aee06a4438b2075de021bbf8d5b6b0c33"><div class="ttname"><a href="classmqtt_1_1async__client.html#aee06a4438b2075de021bbf8d5b6b0c33">mqtt::async_client::connect</a></div><div class="ttdeci">token_ptr connect() override</div><div class="ttdoc">Connects to an MQTT server using the default options. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ad56d21f49709f195e1af37becfc4e0ee"><div class="ttname"><a href="classmqtt_1_1async__client.html#ad56d21f49709f195e1af37becfc4e0ee">mqtt::async_client::disconnect</a></div><div class="ttdeci">token_ptr disconnect(const std::chrono::duration&lt; Rep, Period &gt; &amp;timeout)</div><div class="ttdoc">Disconnects from the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:266</div></div>
<div class="ttc" id="string__collection_8h_html"><div class="ttname"><a href="string__collection_8h.html">string_collection.h</a></div><div class="ttdoc">Definition of the string_collection class for the Paho MQTT C++ library. </div></div>
<div class="ttc" id="classmqtt_1_1connect__options_html"><div class="ttname"><a href="classmqtt_1_1connect__options.html">mqtt::connect_options</a></div><div class="ttdoc">Holds the set of options that control how the client connects to a server. </div><div class="ttdef"><b>Definition:</b> connect_options.h:46</div></div>
<div class="ttc" id="classmqtt_1_1topic_html"><div class="ttname"><a href="classmqtt_1_1topic.html">mqtt::topic</a></div><div class="ttdoc">Represents a topic destination, used for publish/subscribe messaging. </div><div class="ttdef"><b>Definition:</b> topic.h:42</div></div>
<div class="ttc" id="message_8h_html"><div class="ttname"><a href="message_8h.html">message.h</a></div><div class="ttdoc">Declaration of MQTT message class. </div></div>
<div class="ttc" id="callback_8h_html"><div class="ttname"><a href="callback_8h.html">callback.h</a></div><div class="ttdoc">Declaration of MQTT callback class. </div></div>
<div class="ttc" id="classmqtt_1_1buffer__ref_html"><div class="ttname"><a href="classmqtt_1_1buffer__ref.html">mqtt::buffer_ref&lt; char &gt;</a></div></div>
<div class="ttc" id="exception_8h_html"><div class="ttname"><a href="exception_8h.html">exception.h</a></div><div class="ttdoc">Declaration of MQTT exception class. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_abcdbc13e54bb4ba1e52e8e405297d170"><div class="ttname"><a href="classmqtt_1_1async__client.html#abcdbc13e54bb4ba1e52e8e405297d170">mqtt::async_client::start_consuming</a></div><div class="ttdeci">void start_consuming()</div><div class="ttdoc">Start consuming messages. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a7fa8d3dd5b88a5643dcd28e5069da8a5"><div class="ttname"><a href="classmqtt_1_1async__client.html#a7fa8d3dd5b88a5643dcd28e5069da8a5">mqtt::async_client::publish</a></div><div class="ttdeci">delivery_token_ptr publish(string_ref topic, const void *payload, size_t n, int qos, bool retained) override</div><div class="ttdoc">Publishes a message to a topic on the server. </div></div>
<div class="ttc" id="classmqtt_1_1iasync__client_html"><div class="ttname"><a href="classmqtt_1_1iasync__client.html">mqtt::iasync_client</a></div><div class="ttdoc">Enables an application to communicate with an MQTT server using non-blocking methods. </div><div class="ttdef"><b>Definition:</b> iasync_client.h:57</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ae88e293c7e1431ff7a2f74d032b5fd4b"><div class="ttname"><a href="classmqtt_1_1async__client.html#ae88e293c7e1431ff7a2f74d032b5fd4b">mqtt::async_client::disable_callbacks</a></div><div class="ttdeci">void disable_callbacks() override</div><div class="ttdoc">Stops callbacks. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a9260ee858860df9d39dd570cc15f56a1"><div class="ttname"><a href="classmqtt_1_1async__client.html#a9260ee858860df9d39dd570cc15f56a1">mqtt::async_client::try_consume_message</a></div><div class="ttdeci">bool try_consume_message(const_message_ptr *msg)</div><div class="ttdoc">Try to read the next message from the queue without blocking. </div><div class="ttdef"><b>Definition:</b> async_client.h:573</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a5613bf9226d6ad9b8dcf15a238c18c23"><div class="ttname"><a href="classmqtt_1_1async__client.html#a5613bf9226d6ad9b8dcf15a238c18c23">mqtt::async_client::try_consume_message_for</a></div><div class="ttdeci">bool try_consume_message_for(const_message_ptr *msg, const std::chrono::duration&lt; Rep, Period &gt; &amp;relTime)</div><div class="ttdoc">Waits a limited time for a message to arrive. </div><div class="ttdef"><b>Definition:</b> async_client.h:584</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ad42f0639330fffbfe8b9d010be301613"><div class="ttname"><a href="classmqtt_1_1async__client.html#ad42f0639330fffbfe8b9d010be301613">mqtt::async_client::~async_client</a></div><div class="ttdeci">~async_client() override</div><div class="ttdoc">Destructor. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ab5aaa839a2832009148202fa5a81c4f2"><div class="ttname"><a href="classmqtt_1_1async__client.html#ab5aaa839a2832009148202fa5a81c4f2">mqtt::async_client::stop_consuming</a></div><div class="ttdeci">void stop_consuming()</div><div class="ttdoc">Stop consuming messages. </div></div>
<div class="ttc" id="iaction__listener_8h_html"><div class="ttname"><a href="iaction__listener_8h.html">iaction_listener.h</a></div><div class="ttdoc">Declaration of MQTT iaction_listener class. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a8b20a22af1069ef41c27566698bd90bd"><div class="ttname"><a href="classmqtt_1_1async__client.html#a8b20a22af1069ef41c27566698bd90bd">mqtt::async_client::subscribe</a></div><div class="ttdeci">token_ptr subscribe(const_string_collection_ptr topicFilters, const qos_collection &amp;qos) override</div><div class="ttdoc">Subscribe to multiple topics, each of which may include wildcards. </div></div>
<div class="ttc" id="classmqtt_1_1message_html_a4130d0db580fb11ee4a476712f000d48"><div class="ttname"><a href="classmqtt_1_1message.html#a4130d0db580fb11ee4a476712f000d48">mqtt::message::DFLT_RETAINED</a></div><div class="ttdeci">static constexpr bool DFLT_RETAINED</div><div class="ttdoc">The default retained flag. </div><div class="ttdef"><b>Definition:</b> message.h:58</div></div>
<div class="ttc" id="classmqtt_1_1callback_html"><div class="ttname"><a href="classmqtt_1_1callback.html">mqtt::callback</a></div><div class="ttdoc">Provides a mechanism for tracking the completion of an asynchronous action. </div><div class="ttdef"><b>Definition:</b> callback.h:41</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_ae709e53471db54ec614bcc9d8978361e"><div class="ttname"><a href="classmqtt_1_1async__client.html#ae709e53471db54ec614bcc9d8978361e">mqtt::async_client::unsubscribe</a></div><div class="ttdeci">token_ptr unsubscribe(const string &amp;topicFilter) override</div><div class="ttdoc">Requests the server unsubscribe the client from a topic. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a8bc99d5afd5d35aeb0888ff6c08b9ed0"><div class="ttname"><a href="classmqtt_1_1async__client.html#a8bc99d5afd5d35aeb0888ff6c08b9ed0">mqtt::async_client::try_consume_message_until</a></div><div class="ttdeci">bool try_consume_message_until(const_message_ptr *msg, const std::chrono::time_point&lt; Clock, Duration &gt; &amp;absTime)</div><div class="ttdoc">Waits until a specific time for a message to occur. </div><div class="ttdef"><b>Definition:</b> async_client.h:596</div></div>
<div class="ttc" id="delivery__token_8h_html"><div class="ttname"><a href="delivery__token_8h.html">delivery_token.h</a></div><div class="ttdoc">Declaration of MQTT delivery_token class. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a8105627f112a23e5c8067901cf1650a2"><div class="ttname"><a href="classmqtt_1_1async__client.html#a8105627f112a23e5c8067901cf1650a2">mqtt::async_client::get_client_id</a></div><div class="ttdeci">string get_client_id() const override</div><div class="ttdoc">Returns the client ID used by this client. </div><div class="ttdef"><b>Definition:</b> async_client.h:334</div></div>
<div class="ttc" id="iclient__persistence_8h_html"><div class="ttname"><a href="iclient__persistence_8h.html">iclient_persistence.h</a></div><div class="ttdoc">Declaration of MQTT iclient_persistence interface. </div></div>
<div class="ttc" id="classmqtt_1_1token_html"><div class="ttname"><a href="classmqtt_1_1token.html">mqtt::token</a></div><div class="ttdoc">Provides a mechanism for tracking the completion of an asynchronous action. </div><div class="ttdef"><b>Definition:</b> token.h:49</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a804df67eff69884958d897294194a351"><div class="ttname"><a href="classmqtt_1_1async__client.html#a804df67eff69884958d897294194a351">mqtt::async_client::publish</a></div><div class="ttdeci">delivery_token_ptr publish(string_ref topic, binary_ref payload) override</div><div class="ttdoc">Publishes a message to a topic on the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:391</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a45fb67d0f3d678c1d964ec057bf1a473"><div class="ttname"><a href="classmqtt_1_1async__client.html#a45fb67d0f3d678c1d964ec057bf1a473">mqtt::async_client::consumer_queue_type</a></div><div class="ttdeci">std::unique_ptr&lt; thread_queue&lt; const_message_ptr &gt;&gt; consumer_queue_type</div><div class="ttdoc">Type for a thread-safe queue to consume messages synchronously. </div><div class="ttdef"><b>Definition:</b> async_client.h:66</div></div>
<div class="ttc" id="classmqtt_1_1iasync__client_html_aee95659bed2446d0409ce33479f9cdad"><div class="ttname"><a href="classmqtt_1_1iasync__client.html#aee95659bed2446d0409ce33479f9cdad">mqtt::iasync_client::qos_collection</a></div><div class="ttdeci">std::vector&lt; int &gt; qos_collection</div><div class="ttdoc">Type for a collection of QOS values. </div><div class="ttdef"><b>Definition:</b> iasync_client.h:64</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a376960f9e1fbe5e40136f2f07b22d780"><div class="ttname"><a href="classmqtt_1_1async__client.html#a376960f9e1fbe5e40136f2f07b22d780">mqtt::async_client::disconnect</a></div><div class="ttdeci">token_ptr disconnect() override</div><div class="ttdoc">Disconnects from the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:235</div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a8b09cc4d4788420926725b7df00d3448"><div class="ttname"><a href="classmqtt_1_1async__client.html#a8b09cc4d4788420926725b7df00d3448">mqtt::async_client::set_callback</a></div><div class="ttdeci">void set_callback(callback &amp;cb) override</div><div class="ttdoc">Sets a callback listener to use for events that happen asynchronously. </div></div>
<div class="ttc" id="classmqtt_1_1message_html_a9689553c0840b987f5aa064b3692e09c"><div class="ttname"><a href="classmqtt_1_1message.html#a9689553c0840b987f5aa064b3692e09c">mqtt::message::DFLT_QOS</a></div><div class="ttdeci">static constexpr int DFLT_QOS</div><div class="ttdoc">The default QoS for a message. </div><div class="ttdef"><b>Definition:</b> message.h:56</div></div>
<div class="ttc" id="classmqtt_1_1disconnect__options_html"><div class="ttname"><a href="classmqtt_1_1disconnect__options.html">mqtt::disconnect_options</a></div><div class="ttdoc">Options for disconnecting from an MQTT broker. </div><div class="ttdef"><b>Definition:</b> disconnect_options.h:37</div></div>
<div class="ttc" id="iasync__client_8h_html"><div class="ttname"><a href="iasync__client_8h.html">iasync_client.h</a></div><div class="ttdoc">Implementation of the interface for the asynchronous clients, &#39;iasync_client&#39;. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a425e5e48369a523378b6c92de7bf4b85"><div class="ttname"><a href="classmqtt_1_1async__client.html#a425e5e48369a523378b6c92de7bf4b85">mqtt::async_client::publish</a></div><div class="ttdeci">delivery_token_ptr publish(string_ref topic, const void *payload, size_t n) override</div><div class="ttdoc">Publishes a message to a topic on the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:367</div></div>
<div class="ttc" id="token_8h_html"><div class="ttname"><a href="token_8h.html">token.h</a></div><div class="ttdoc">Declaration of MQTT token class. </div></div>
<div class="ttc" id="classmqtt_1_1async__client_html_a5f9175e2992ec07e0d27286f875ba107"><div class="ttname"><a href="classmqtt_1_1async__client.html#a5f9175e2992ec07e0d27286f875ba107">mqtt::async_client::disconnect</a></div><div class="ttdeci">token_ptr disconnect(const std::chrono::duration&lt; Rep, Period &gt; &amp;timeout, void *userContext, iaction_listener &amp;cb)</div><div class="ttdoc">Disconnects from the server. </div><div class="ttdef"><b>Definition:</b> async_client.h:301</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_503ebd9f384f44c9859dcb1451d026bc.html">mqtt</a></li><li class="navelem"><a class="el" href="async__client_8h.html">async_client.h</a></li>
    <li class="footer">Generated on Sun Jul 23 2017 10:24:29 for Paho C++ by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
